Skip to content

Add Health connect snippets#866

Open
shounbi wants to merge 9 commits intoandroid:mainfrom
shounbi:health-connect-integration
Open

Add Health connect snippets#866
shounbi wants to merge 9 commits intoandroid:mainfrom
shounbi:health-connect-integration

Conversation

@shounbi
Copy link
Copy Markdown

@shounbi shounbi commented Apr 9, 2026

Add Health Connect snippets to main.

@snippet-bot
Copy link
Copy Markdown

snippet-bot bot commented Apr 9, 2026

Here is the summary of changes.

You are about to add 10 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the healthconnect module, providing integration with the Health Connect API. Key additions include managers for handling data changes and records, a background worker for periodic reads, and a companion service for wearable devices. Feedback focuses on correcting a package name error in the theme configuration, removing duplicate dependencies and unused imports, and cleaning up unused constructor parameters in the manager classes. Additionally, a misleading comment regarding an early return in the UI logic should be clarified.

Comment thread healthconnect/src/main/java/com/example/healthconnect/ui/theme/Color.kt Outdated
Comment thread healthconnect/build.gradle.kts Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectActivity.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
@shounbi shounbi changed the title Health connect integration Add Health connect snippets Apr 9, 2026
Comment thread healthconnect/src/main/java/com/example/healthconnect/ui/theme/Color.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectActivity.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectActivity.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectManager.kt Outdated
Comment thread healthconnect/src/main/AndroidManifest.xml Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
@shounbi shounbi requested a review from yrezgui April 10, 2026 15:19
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/ChangesManager.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectActivity.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectWorker.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectWorker.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/HealthConnectWorker.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/MyWearableService.kt Outdated
Comment thread healthconnect/src/main/java/com/example/healthconnect/MyWearableService.kt Outdated
@shounbi shounbi requested a review from yrezgui April 10, 2026 15:42
Copy link
Copy Markdown
Contributor

@kkuan2011 kkuan2011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the GitHub workflows, and it looks like the spotless check failed as well as the build. I have a suggestion for fixing the build, but not sure about the spotless check error. I wonder if you have to squash all your commits into 1 commit, and then force push the branch again, so that there's only 1 commit on top of main?

@@ -0,0 +1,37 @@
package com.example.healthconnect
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add copyright header

@@ -0,0 +1,37 @@
package com.example.healthconnect.ui.theme
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header

@@ -0,0 +1,139 @@
/*
* Copyright 2026 The Android Open Source Project
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the copyright header needs to be the full text of the copyright notice (I believe it's about 15 lines long)

@@ -0,0 +1,102 @@
/*
* Copyright 2026 The Android Open Source Project
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use full length version of the copyright header

@@ -0,0 +1,45 @@
package com.example.healthconnect

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header for this file and all other files missing it too please

private var healthConnectClient: HealthConnectClient? = null
private var bluetoothGatt: BluetoothGatt? = null

@Deprecated("Deprecated in Java")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come we have this deprecated annotation?


android {
namespace = "com.example.healthconnect"
compileSdkPreview = "CinnamonBun"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is failing, so I think you need a change similar to this one:
f6e34d2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants